﻿using JetBrains.Annotations;
using Volo.Abp;

namespace Shared.Service.DataScopes
{
    /// <summary>
    /// 数据范围
    /// </summary>
    public class DataScopeInfo: BaseDataScope
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// 
        /// </summary>
        public string ProviderName { get; }

        /// <summary>
        /// 
        /// </summary>
        public string ProviderKey { get; }

        /// <summary>
        /// 
        /// </summary>
        public override DataScopeType ScopeType { get; }

        /// <summary>
        /// 
        /// </summary>
        public override string[] ScopeKeys { get; set; }

        public DataScopeInfo([NotNull] string name, string providerName, string providerKey,
            DataScopeType scopeType, params string[] scopeKeys)
        {
            Check.NotNull(name, nameof(name));
            Check.NotNull(providerName, nameof(providerName));
            Check.NotNull(providerKey, nameof(providerKey));

            Name = name;
            ProviderName = providerName;
            ProviderKey = providerKey;
            ScopeType = scopeType;

            ScopeKeys = scopeKeys ?? new string[0];
        }
    }
}
